<?php

 /**
  * @package JooS
  * @subpackage PHPackager
  */

  require_once "JooS/PHPackager/DOM/Node.php";

  abstract class JooS_PHPackager_DOM_ProcessingInstruction extends JooS_PHPackager_DOM_Node {
    /**
     * @var string
     */
    private $_compiledCode;

    abstract public function getSyntaxLanguage();

    /**
     * @return string
     */
    public function getCompiledCode() {
      return $this->_compiledCode;
    }

    /**
     * @return JooS_PHPackager_DOM_ProcessingInstruction
     */
    public function make() {
      $DOMProcessingInstruction = $this->getNode();
      $data = $DOMProcessingInstruction->data;

      $this->_compiledCode = $this->compileSource($data, $this->getSyntaxLanguage());
      if ($this->_compiledCode === false)
        self::throwException("Parse Error in " . $DOMProcessingInstruction->target . ":\n" . $data);

      return $this;
    }
  }
